﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="OLMS.Index" MasterPageFile="~/Site.Master" %>

<asp:Content ID="head" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="content" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="pure-g">
        <div class="pure-u-1-5">
            <div class="pure-menu sidebar">
                <span class="pure-menu-heading">音乐类型</span>
                <ul class="pure-menu-list">
                    <asp:Repeater ID="repGenres" runat="server">
                        <ItemTemplate>
                            <li class="pure-menu-item">
                                <asp:LinkButton ID="btnGenres" runat="server" CssClass="pure-menu-link" CommandArgument='<%# Eval("GenreId") %>' OnCommand="btnGenres_Command" ToolTip='<%# Eval("Description") %>'><%# Eval("Name") %></asp:LinkButton>
                            </li>
                        </ItemTemplate>
                    </asp:Repeater>
                </ul>
            </div>
        </div>
        <div class="pure-u-4-5 content">
            <div class="pure-g">
                <div class="pure-u-3-5">
                    音乐类型&nbsp;&nbsp;<i class="fa fa-angle-double-right"></i>&nbsp;&nbsp;<asp:Label ID="lblGenre" CssClass="lblGenre" runat="server" Text=""></asp:Label>
                </div>
                <div class="pure-u-2-5 pure-form">
                    <asp:TextBox ID="txtSearchKey" runat="server" placeholder="请输入专辑关键字..."></asp:TextBox>
                    <asp:LinkButton ID="btnSearch" runat="server" CssClass="button-default pure-button pure-button-primary" OnClick="btnSearch_Click">搜索</asp:LinkButton>
                </div>
            </div>
            <div class="pure-g">
                <asp:Repeater ID="repAlbums" runat="server">
                    <ItemTemplate>
                        <div class="pure-u-1-5 genre-item">
                            <div class="music-image">
                                <img src=' <%# Eval("AlbumArtUrl") %>' alt='<%# Eval("Title") %>' />
                            </div>
                            <div class="music-body">
                                <span class="music-title"><%# Eval("Title") %></span>
                                <span class="music-artist"><%# Eval("ArtistName") %></span>
                                <span class="music-price"><%# Eval("Price","{0:C}元") %></span>
                                <asp:LinkButton ID="btnAddCart" runat="server" CommandArgument='<%# Eval("AlbumId") %>' CssClass="button-default pure-button" OnCommand="btnAddCart_Command">加入购物车</asp:LinkButton>
                            </div>
                        </div>
                    </ItemTemplate>
                </asp:Repeater>
            </div>
            <div class="pager">
                <asp:Label ID="lblPager" runat="server" Text=""></asp:Label>
                <asp:LinkButton ID="btnFirst" runat="server" CssClass="button-default pure-button" OnClick="btnFirst_Click">首页</asp:LinkButton>
                <asp:LinkButton ID="btnPrev" runat="server" CssClass="button-default pure-button" OnClick="btnPrev_Click">上页</asp:LinkButton>
                <asp:LinkButton ID="btnNext" runat="server" CssClass="button-default pure-button" OnClick="btnNext_Click">下页</asp:LinkButton>
                <asp:LinkButton ID="btnLast" runat="server" CssClass="button-default pure-button" OnClick="btnLast_Click">末页</asp:LinkButton>
            </div>
        </div>
    </div>
    <script src="Assets/js/jquery-3.4.1.min.js"></script>
    <script>
        $(function () {
            var genre = $(".lblGenre").text();
            $(".pure-menu-link").each(function () {
                if ($(this).text() == genre) {
                    $(this).parent().addClass("pure-menu-disabled");
                }
            })
        });
    </script>
</asp:Content>
